import { BrowserRouter } from "react-router-dom";
import { Suspense } from "react"
import { Spin } from "antd"
import App from '../pages/startPage';
import { Routes, Route, Navigate } from "react-router-dom";
import Login from "../pages/login"
import Page404 from '../pages/page404/404';
function IndexRouter() {
  return (
    <BrowserRouter>
      <Suspense fallback={<Spin />}>
        <Routes>
          <Route path={"/login"} element={<Login />} />
          <Route path="/app/*" element={<App />} />
          <Route
            path="/"
            element={<Navigate to="/app/index" replace />}
          />
          <Route path="*" element={<Page404 />} />
        </Routes>
      </Suspense>
    </BrowserRouter>
  )
}

export default IndexRouter